import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

public class Dome9 {
    public static void main(String[] args) {
        BlockingQueue<Integer> queue = new ArrayBlockingQueue<>(1000);

        //消费者
        Thread t1 = new Thread(()-> {
            try {
                while(true) {
                    Integer value = queue.take();
                    System.out.println("t1消费:" + value);
                    //每隔1s
                    // 生产一元素

                }
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

        });
    }
}
